package org.jetlinks.pro.notify.manager;

import org.jetlinks.core.event.EventBus;
import org.jetlinks.pro.notify.sms.TestSmsProvider;
import org.jetlinks.pro.notify.template.TemplateManager;
import org.jetlinks.supports.cluster.redis.RedisClusterManager;
import org.jetlinks.supports.event.BrokerEventBus;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.ReactiveRedisTemplate;

/**
 * 输入描述.
 *
 * @author zhangji
 * @version 1.11 2021/12/28
 */
@Configuration
public class NotifyTestConfiguration {
    @Bean
    public EventBus eventBus() {
        return new BrokerEventBus();
    }

    @Bean(initMethod = "startup", destroyMethod = "shutdown")
    public RedisClusterManager clusterManager(ReactiveRedisTemplate<Object, Object> template) {
        return new RedisClusterManager("test", "test", template);
    }

    @Bean
    public TestSmsProvider testSmsProvider(TemplateManager templateManager) {
        return new TestSmsProvider(templateManager);
    }
}
